package org.jradweb.core.orm;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import org.apache.log4j.Logger;

/**
 * 
 * 
 * Created On 2008-4-7
 * 
 * @author <a href="mailto:wagzhi@gmail.com">Paul Wang</a>
 * @version $Id: AbstractModel.java 149 2008-10-10 03:10:10Z wagzhi $
 */
@javax.persistence.MappedSuperclass
public abstract class AbstractModel<T> extends HibernateModel<T,Integer> {

	private static final Logger log = Logger.getLogger(AbstractModel.class);

	protected Integer id;
	protected Date createdAt = new Date();
	protected Date updatedAt = new Date();

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "created_at")
	public Date getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}

	@Column(name = "updated_at")
	public Date getUpdatedAt() {
		return updatedAt;
	}

	public void setUpdatedAt(Date updatedAt) {
		this.updatedAt = updatedAt;
	}

	

}
